package com.esri.core.tasks.ags.geoprocessing;

import com.esri.core.internal.util.d;
import com.esri.core.io.EsriServiceException;
import java.util.ArrayList;
import org.codehaus.jackson.JsonParser;
import org.codehaus.jackson.JsonToken;

/* loaded from: classes.dex */
public class GPJobParameter {
    private String paramName;
    private String paramURL;

    public void setParamName(String str) {
        this.paramName = str;
    }

    public void setParamURL(String str) {
        this.paramURL = str;
    }

    public String getParamName() {
        return this.paramName;
    }

    public String getParamURL() {
        return this.paramURL;
    }

    public static GPJobParameter[] fromJson(JsonParser jsonParser) throws Exception {
        if (!d.c(jsonParser)) {
            throw new EsriServiceException("Unable to parse the Response for this GPJobParameter.");
        }
        ArrayList arrayList = new ArrayList();
        while (jsonParser.nextToken() != JsonToken.END_OBJECT) {
            GPJobParameter gPJobParameter = new GPJobParameter();
            gPJobParameter.paramName = jsonParser.getCurrentName();
            jsonParser.nextToken();
            if (jsonParser.getCurrentToken() == JsonToken.START_OBJECT) {
                jsonParser.nextToken();
                if ("paramUrl".equals(jsonParser.getCurrentName())) {
                    jsonParser.nextToken();
                    gPJobParameter.paramURL = jsonParser.getText();
                    arrayList.add(gPJobParameter);
                    jsonParser.nextToken();
                } else {
                    jsonParser.skipChildren();
                }
            } else {
                gPJobParameter.paramURL = jsonParser.getText();
                arrayList.add(gPJobParameter);
            }
        }
        return (GPJobParameter[]) arrayList.toArray(new GPJobParameter[0]);
    }
}
